#pragma once

#include <unordered_map>
#include "../share/user_define.h"
#include "../../3rd/libjson/json.h"


struct UInt32_5x
{
	uint32_t mValue[5];
};

struct Shop
{
	uint32_t mId;
	uint32_t mGoodsNum;

	uint32_t mSoulNum[2];
	std::vector<UInt32_5x> mSoulStone;

	uint32_t mExpNum[2];
	std::vector<UInt32_5x> mExpMaterial;

	uint32_t mPropNum[2];
	std::vector<UInt32_5x> mProp;

	uint32_t mPropPieceNum[2];
	std::vector<UInt32_5x> mPropPiece;

	uint32_t mDiamondPropNum[2];
	std::vector<UInt32_5x> mDiamondProp;

	std::vector<UInt32_5x> mGoldProp;
	uint32_t mRefreshPoint[4];

	Shop()
	{
		Clear();
	}

	void Clear(void)
	{

	}
};

class ShopCacheData
{
public:

	static void CreateInstance(void);
	static ShopCacheData* GetInstance(void);

	~ShopCacheData(void);

public:

	bool Initialization(void);

	bool Reload(void);

	Shop* GetData(uint32_t id);

	bool GetDataJsonString(uint32_t id, Json::Value& _jm);

	uint32_t GetDataCount(void);

private:
	ShopCacheData(void);

	void Clear(void);

	void AddData(uint32_t id, Json::Value& jm);


private:

	static ShopCacheData* mInstance;

	std::unordered_map<uint32_t, Shop*> m_mapCacheData;
	uint32_t m_maxCount;

};